import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class ArrayList01 {

	public static void main(String[] args) {
	}
}

	


interface INT{

	public int i = 0;
	static double d = 1.3;	
}

class A implements INT{


}


class B{
	public static void f(){
		System.out.println("1");
	}

}

class C extends B{

}


class D{
	public String name;
	
	public D(String name){
		this.name = name;
	}
	
}

class DD extends D{
	public String name;
	
	public DD(String name){
		super(name);
		this.name = name;
	}
	
	public void f(){
		System.out.println(this.name);
		System.out.println(super.name);
		
	}
}


interface INE{
	public abstract void ff();
}

interface INF {
	public abstract void ff();
}

class E implements INE,INF{

	@Override
	public void ff() {
		// TODO Auto-generated method stub

	}

}

class AA extends RequstQuene  implements INE {

	@Override
	public void ff() {
		// TODO Auto-generated method stub
		
	}
	
}

class dddd{
	
}

abstract class AAA extends dddd{
	
}

class RequstQuene{
	private String[] tarChar = {"A","B","C"};

	private int curLoop;

	private int curCharIndex;

	public static final int  totalLoopCount = 10;

	public synchronized void printChar(String threadName){
		if(! threadName.equals(tarChar[curCharIndex]) && curLoop < totalLoopCount){
			try {
				wait();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

		if(curLoop < totalLoopCount){
			System.out.print(tarChar[curCharIndex]);
			curCharIndex = (++curCharIndex) % tarChar.length;
			
			if(curCharIndex == 0){
				++curLoop;
				System.out.print("  ");
			}
				
		}

		notifyAll();
	}

	public int getCurLoop() {
		return curLoop;
	}

	public static int getTotalloopcount() {
		return totalLoopCount;
	}


}



class PrintThr extends Thread{
	private RequstQuene rq;;

	private String name;

	public PrintThr(String name,RequstQuene rq) {
		super(name);
		this.name = name;
		this.rq = rq;
	}


	@Override
	public void run(){
		//synchronized(this){
			while(rq.getCurLoop() < RequstQuene.totalLoopCount)
				rq.printChar(name);
		//}
		
	}
}


class AAAAA{
	public AAAAA(){
		System.out.println("A");
		init();
	}
	
	void init(){
		System.out.println("-1");
	}
	
	private int i;
	
	public void setI(int i){
		this.i = i;
	}
	
	public void showI(){
		System.out.println(i);
	}
	
}
class BBBB extends AAAAA{
	public BBBB(){
		super();
	}
	
	void init(){
		System.out.println("-2");
	}
}






